/**
 * Created by oneminute on 2014/4/24.
 * 主启动脚本。
 */

var appsConfig = require("./config/apps_config");
var lz = require("./lib/utils/modules")();

for (var prop in appsConfig.roles) {
    if (prop.indexOf("app_") == 0) {
        try {
            if (appsConfig.roles[prop].enable) {
                var module = require(appsConfig.appBase + appsConfig.roles[prop].module);
                module[appsConfig.startupMethod]();
            }
        } catch (e) {
            lz.Logger.error("应用模块加载失败: ", e.message);
        }
    }
};
